import requests from "@/utils/request";

export function getOrderList(query) {
    return requests({
        url: '/platform/order/getOrderList',
        method: 'get',
        params: query
    })
}

export function getOrder(orderId) {
    return requests({
        url: '/platform/order/getOrder/' + orderId,
        method: 'get'
    })
}

export function notifyOrderPaySuccess(orderId) {
    return requests({
        url: '/platform/order/orderPaySuccess/' + orderId,
        method: 'post'
    })
}

export function checkOrder(orderId) {
    return requests({
        url: '/platform/order/checkOrderIsFinished/' + orderId,
        method: 'get'
    })
}

export function checkAddrNeeded(orderId) {
    return requests({
        url: '/platform/order/checkAddrNeeded/' + orderId,
        method: 'get'
    })
}

export function submitOrder(addrId, orderId) {
    return requests({
        url: '/platform/order/submitOrder',
        method: 'post',
        data: JSON.stringify({
            addr_id: addrId,
            orderId: orderId
        })
    })
}